{% extends "base.html" %}

{% block title %}
分类
{% endblock %}

{%block css%}
<style type="text/css">
  table {
    width: 100%;
    text-align: center;
    line-height: 40px;
  }

  button {
    background: #32aa66;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 10%;
    border: none;
  }
</style>
{% endblock %}

{% block content %}
<div style="background:#fff;padding:15px;box-sizing:border-box;">
  <ul class="tabtitle">
    <li class="on">分类管理</li>
  </ul>
  <table>
    <tr>
      <th>ID</th>
      <th>名称</th>
      <th>顺序</th>
      <th>操作</th>
    </tr>
    {% for cls in base.webclass %}
    <tr>
      <td>{{cls.id|uw}}</td>
      <td>{{cls.class|uw}}</td>
      <td>{{cls.ord|uw}}</td>
      <td>
        <button onclick="saveClass(this,{{cls.id|uw}})">修改</button>
        <button style="margin-left: 5px;" onclick="delClass({{cls.id|uw}})">删除</button>
      </td>
    </tr>
    {% endfor %}
    <tr>
      <td></td>
      <td></td>
      <td>
        <button onclick="saveClass(this,0)">新增</button>
        <div id="errmsg"></div>
      </td>
    </tr>
  </table>
</div>
{% endblock %}
